Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wallet-dashboard): other assets #4574

Merged
merged 10 commits into from
Dec 20, 2024

Conversation

cpl121
Copy link
Member

@cpl121 cpl121 commented Dec 19, 2024

Description of change

Other assets in the dashboard should not contain Coins nor NFTs, it contains at least coins for now
Other assets should just open a new tab in the explorer

Links to any relevant issues

Closes #4572

Type of change

Choose a type of change, and delete any options that are not relevant.

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Describe the tests that you ran to verify your changes.

Make sure to provide instructions for the maintainer as well as any relevant configurations.

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@cpl121 cpl121 requested a review from a team as a code owner December 19, 2024 16:08
@iota-ci iota-ci added the tooling Issues related to the Tooling team label Dec 19, 2024
@cpl121 cpl121 added the wallet-dashboard Issues related to the Wallet Dashboard dApp label Dec 19, 2024
Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: f62f401

✅ Preview: https://wallet-dashboard-bjjykixrs-iota1.vercel.app

Copy link
Contributor

@brancoder brancoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a nit about code optimization and reverting code added in previous PR

Comment on lines 40 to 41
const visualAssets: IotaObjectData[] = [];
const otherAssets: IotaObjectData[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we simplified this code by removing visualAssets and otherAssets based on the comment in this PR > #4038 (comment)
with this PR we would be reverting back the changes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That code was incorrect because the objects were always pushed to assets array
if (selectedCategory == AssetCategory.Visual) { if(hasDisplayData(asset)) { assets.push(asset.data); } } else if(selectedCategory == AssetCategory.Other) { assets.push(asset.data); }
I have added a Map to simplify the code, but also to be able to separate it into the 2 categories, take a look and tell me what you think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think that it was correct because only one array is shown at a time. that means that everything can be stored in the same array

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, since before the NFTs were shown with the others filter
Captura desde 2024-12-20 09-29-29

@cpl121 cpl121 requested a review from brancoder December 20, 2024 07:42
Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 9b816ec

✅ Preview: https://wallet-dashboard-4gkgpiyw7-iota1.vercel.app

@@ -31,21 +31,23 @@ export default function AssetsDashboardPage(): React.JSX.Element {
const account = useCurrentAccount();
const { data, isFetching, fetchNextPage, hasNextPage, refetch } = useGetOwnedObjects(
account?.address,
undefined,
{
MatchNone: [{ StructType: '0x2::coin::Coin' }],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MatchNone: [{ StructType: '0x2::coin::Coin' }],
MatchNone: [{ StructType: COIN_TYPE }],

OBJECTS_PER_REQ,
);

const assets: IotaObjectData[] = [];
const assets = new Map<string, IotaObjectData[]>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const assets = new Map<string, IotaObjectData[]>(
const assets = new Map<AssetCategory, IotaObjectData[]>(

OBJECTS_PER_REQ,
);

const assets: IotaObjectData[] = [];
const assets = new Map<string, IotaObjectData[]>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't have used a Map as you already know what/how many entries are going to be, I would just have made it a record like ASSET_CATEGORIES, just a thought 👍🏻

@github-actions github-actions bot added the explorer Issues related to the Explorer label Dec 20, 2024
@cpl121 cpl121 requested a review from marc2332 December 20, 2024 08:55
Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 71d93ce

✅ Preview: https://apps-backend-n00ft7lrq-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 71d93ce

✅ Preview: https://rebased-explorer-2b6go5lxd-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 71d93ce

✅ Preview: https://wallet-dashboard-9dcbepyg2-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: f1a82ec

✅ Preview: https://apps-backend-op28c6b1g-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: f1a82ec

✅ Preview: https://rebased-explorer-6rhkatgym-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: f1a82ec

✅ Preview: https://wallet-dashboard-hq59iy3pg-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 3dfce33

✅ Preview: https://apps-backend-qsso65nvt-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 3dfce33

✅ Preview: https://rebased-explorer-bo3hj1sjf-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 3dfce33

✅ Preview: https://wallet-dashboard-3ga6kz17x-iota1.vercel.app

Copy link
Contributor

@brancoder brancoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎊

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: baebe6b

✅ Preview: https://apps-backend-qclek18h3-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: baebe6b

✅ Preview: https://rebased-explorer-p5opjiayo-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: baebe6b

✅ Preview: https://wallet-dashboard-edtkuc4vm-iota1.vercel.app

Copy link
Contributor

@panteleymonchuk panteleymonchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good 🚀

Just FYI this PR might be crossing with #4512

@@ -24,7 +25,7 @@ export async function split_coin(address: string) {
const tx = new Transaction();
tx.moveCall({
target: '0x2::pay::split',
typeArguments: ['0x2::iota::IOTA'],
typeArguments: [COIN_TYPE],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this!!

@marc2332 marc2332 self-requested a review December 20, 2024 15:13
Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: dfba076

✅ Preview: https://apps-backend-p757dl1o1-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: dfba076

✅ Preview: https://rebased-explorer-i44ofv6wx-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: dfba076

✅ Preview: https://wallet-dashboard-1jzyxng79-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: dc3ea7f

✅ Preview: https://apps-backend-e3a3tpk01-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: dc3ea7f

✅ Preview: https://rebased-explorer-pjifjxyrv-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: dc3ea7f

✅ Preview: https://wallet-dashboard-e1vgf7s14-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 060870c

✅ Preview: https://apps-backend-iplfa4kp1-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 060870c

✅ Preview: https://rebased-explorer-jaal8672i-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 060870c

✅ Preview: https://wallet-dashboard-q5s40i04z-iota1.vercel.app

@marc2332 marc2332 merged commit 92ddb6b into develop Dec 20, 2024
35 checks passed
@marc2332 marc2332 deleted the tooling-dashboard/fix-other-assets branch December 20, 2024 15:47
miker83z pushed a commit that referenced this pull request Dec 20, 2024
* fix(wallet-dashboard): other assets

* fix(dashboard): simplified code

* feat(core): add a new COIN_TYPE constant

* fix(dashboard): revert changes of assets array and use new COIN_TYPE constant

* fix(dashboard): improve the assets filter

* fix(core): linter

* fix(explorer): Revert localnet.ts

* fix(core): Revert timelock.constants.ts

* '

---------

Co-authored-by: Bran <[email protected]>
Co-authored-by: marc2332 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
explorer Issues related to the Explorer tooling Issues related to the Tooling team wallet-dashboard Issues related to the Wallet Dashboard dApp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix other assets
5 participants